package net.uhuijia.market.marketbanner.controller;

import net.uhuijia.exception.ParameterErrorException;
import net.uhuijia.market.marketbanner.persistence.model.MarketBanner;
import net.uhuijia.market.marketbanner.persistence.model.MarketBannerExample;
import net.uhuijia.utils.StringHelper;
import net.uhuijia.utils.ValueHelper;
import net.uhuijia.vo.ResultMapVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMapping;
import net.uhuijia.appbase.controller.BaseController;
import net.uhuijia.market.marketbanner.service.MarketBannerService;

import java.util.List;
import java.util.Map;


@RestController
@RequestMapping(value="/marketbanner")
public class MarketBannerController
     extends BaseController<MarketBannerService,MarketBanner,MarketBannerExample> {


    @RequestMapping(value = "/getByProject")
    public ResultMapVo<List<Map<String, Object>>> getByProject( String project )
    {
        if(StringHelper.isNotBlanks(project)){
            List<MarketBanner> list = s.getByProject(project);
            List<Map<String, Object>> result = ValueHelper.tranList2MapList(list, ignoreProperties);
            return ResultMapVo.ok(result);
        }else{
            throw new IllegalArgumentException();
        }
    }
}